CFLAGS = -Wall  -I/home/muromec/ming/ezx_linux/code/linux/linux-2.4.17/include/ -DCONFIG_ARCH_EZX
CROSS ?= arm-linux-
CC    = $(CROSS)gcc
STRIP = $(CROSS)strip

TOOLS = motod hwtool atd ezx-hciattach

all: $(TOOLS)

atd: atd.c
	$(CC) $(CFLAGS) -o $@ $<

motod: motod.c 
	$(CC) $(CFLAGS) -DMOTOD_VER=\"v0.3\" -o $@ $<

hwtool: hwtool.c
	$(CC) $(CFLAGS) -o $@ $<

release-motod: motod
	cat $< | bzip2 -9 > $<.$$(date +%d.%m.%y).bz2

release-hwtool: hwtool
	cat $< | bzip2 -9 > $<.$$(date +%d.%m.%y).bz2

release-ezx-hciattach: ezx-hciattach
	cat $< | bzip2 -9 > $<.$$(date +%d.%m.%y).bz2

release: release-motod 	release-hwtool release-ezx-hciattach

clean:
	rm -f $(TOOLS)

strip: $(TOOLS)
	$(STRIP) $(TOOLS)




